package util;

//import javax.jms.Connection;
//import javax.jms.ConnectionFactory;
//import javax.jms.JMSException;
//
//import org.apache.activemq.ActiveMQConnectionFactory;
//import org.apache.activemq.ActiveMQPrefetchPolicy;

public class JMSUtils {
	
	private final static String URL = "jms.url";
	private final static String USER = "jms.user";
	private final static String PSD = "jms.password";
	
//	private ConnectionFactory connectionFactory;
	private static JMSUtils jmsConnection;
	
	
	private  JMSUtils(){
		//failover:
//		ActiveMQConnectionFactory aConnectionFactory = new ActiveMQConnectionFactory(PropertiesUtils.getProperties(URL));
//		aConnectionFactory.setUserName(PropertiesUtils.getProperties(USER));
//		aConnectionFactory.setPassword(PropertiesUtils.getProperties(PSD));
//		ActiveMQPrefetchPolicy p = new ActiveMQPrefetchPolicy();
//		p.setQueuePrefetch(1);
//		aConnectionFactory.setPrefetchPolicy(p);
//		connectionFactory = aConnectionFactory;
	}
	
	public static JMSUtils getInstance(){
//		if (jmsConnection==null) {
//			synchronized (JMSUtils.class) {
//				if (jmsConnection==null) {
//					jmsConnection = new JMSUtils();
//				}
//			}
//		}
//		return jmsConnection;
		return null;
	}
	
//	public Connection createConnection(){
//		try {
//			return connectionFactory.createConnection();
//		} catch (JMSException e) {
//			e.printStackTrace();
//		}
//		return null;
//	}
	


}
